<template>
  <!--    页脚(完成)-->
    <footer id="footer" :class="store.footerBlur ? 'blur' : null">
        <Transition mode="out-in" name="fade">
            <div class="power">
        <span>
          Copyright&nbsp;&copy;
           2023
          <a :href="siteUrl">{{ AUTHOR }}</a>
        </span>
                <!-- 以下信息请不要修改哦 -->
                <span class="hidden">
          &amp;&nbsp;Made&nbsp;by
            {{ NAME }}
        </span>
                <!-- 站点备案 -->
                <a href="https://beian.miit.gov.cn" target="_blank">
                    &amp;
                    {{ ICP }}
                </a>
            </div>
        </Transition>
    </footer>
</template>

<script setup>
import {mainStore} from "@/store";
import {AUTHOR, ICP, NAME, URL} from '@/utils/constants.js';
import {computed} from "vue";

const store = mainStore();

// 加载配置数据
const siteUrl = computed(() => {
    const url = URL;
    // 判断协议前缀
    if (!url.startsWith("http://") && !url.startsWith("https://")) {
        return "//" + url;
    }
    return url;
});

</script>

<style lang="scss" scoped>
#footer {
  width: 100%;
  position: absolute;
  bottom: 0;
  left: 0;
  height: 46px;
  line-height: 46px;
  text-align: center;
  z-index: 0;
  font-size: 14px;

  .power {
    animation: fade 0.3s;
  }

  .lrc {
    padding: 0 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    .lrc-all {
      width: 98%;
      display: flex;
      flex-direction: row;
      justify-content: center;
      align-items: center;

      .lrc-text {
        margin: 0 8px;
      }

      .i-icon {
        width: 18px;
        height: 18px;
        display: inherit;
      }
    }
  }

  &.blur {
    backdrop-filter: blur(10px);
    background: rgb(0 0 0 / 25%);
    font-size: 16px;
  }

  .fade-enter-active,
  .fade-leave-active {
    transition: opacity 0.15s ease-in-out;
  }

  @media (max-width: 720px) {
    font-size: 0.85rem;
    &.blur {
      font-size: 0.85rem;
    }
  }
  @media (max-width: 480px) {
    .hidden {
      display: none;
    }
  }
}
</style>
